export function configForm() {
  return [
    {
      fieldName: "采购包或标段编码",
      field: "crsrm_bidding_id",
      value: "",
      type: "input",
      placeholder: "请输入采购包或标段编码"
    },
    {
      fieldName: "采购包或标段名称",
      field: "crsrm_bidding_name",
      value: "",
      type: "input",
      placeholder: "请输入采购包或标段名称"
    },
    {
      fieldName: "投标人/供应商名称",
      field: "crsrm_supplier_name",
      value: "",
      type: "input",
      placeholder: "请输入投标人/供应商名称"
    },
    {
      fieldName: "投标人/供应商代码",
      field: "crsrm_supplier_social_credit",
      value: "",
      type: "input",
      placeholder: "请输入投标人/供应商代码"
    },
    {
      fieldName: "数据来源",
      field: "crsrm_data_source",
      value: "",
      type: "select",
      placeholder: "请选择数据来源",
      optionList: this.crsrm_pur_data_source
    },
    {
      fieldName: "更新时间从",
      field: "start_date",
      aliasField: 'startDate',
      value: "",
      type: "date",
      placeholder: "请选择"
    },
    {
      fieldName: "更新时间至",
      field: "end_date",
      aliasField: 'endDate',
      value: "",
      type: "date",
      placeholder: "请选择"
    },
    {
      fieldName: "采购人所属一级利润中心",
      field: "crsrm_purchaser_sbu",
      value: "",
      type: "select",
      optionList: this.crsrm_purchaser_sbu
    },
    {
      fieldName: "数据状态",
      field: "crsrm_state",
      value: "",
      type: "select",
      placeholder: "请选择润智采-数据状态",
      optionList: this.crsrm_pur_state
    },
    {
      fieldName: "校验结果",
      field: "resultState",
      value: [],
      type: "select",
      optionList: this.crsrm_pur_result_state,
      isMul: true,
    },
/*    {
      fieldName: "上报国资委状态",
      field: "push_state",
      value: "",
      type: "select",
      optionList: this.crsrm_push_state
    }*/
    {
      fieldName: "整改状态",
      field: "crsrm_rectify_flag",
      value: "",
      type: "select",
      optionList: this.crsrm_rectify_flag,
    },
  ];
}

export function generateColumns() {
  return [
    {
      type: "selection",
      width: 60,
      align: "center",
      fixed: "left"
    },
    {
      title: "校验结果",
      align: "center",
      key: "resultState",
      render: (h, { row }) => {
        return this.resultHandle(h, row);
      }
    },
    {
      title: "数据状态",
      key: "crsrmStateStr",
      render: (h, { row }) => {
        return this.dataStateHandle(h, row)
      }
    },
    {
      title: "数据来源",
      key: "crsrmDataSourceStr"
    },
    {
      title: "采购包或标段编号",
      key: "crsrmBiddingId",
      minWidth: 160
    },
    {
      title: "采购包或标段名称",
      key: "crsrmBiddingName",
      minWidth: 160
    },
    {
      title: "投标人/供应商总数",
      key: "crsrmSupplierQty",
      minWidth: 160
    },
    {
      title: "投标人/供应商名称",
      key: "crsrmSupplierName",
      minWidth: 160
    },
    {
      title: "投标人/供应商代码",
      key: "crsrmSupplierSocialCredit",
      minWidth: 160
    },
    {
      title: "投标人文件分项报价表",
      key: "crsrmBiddingDocument",
      minWidth: 160
    },
    {
      title: '流程状态',
      width: 180,
      resizable:true,
      key: 'bpmnState',
      render: (h, { row }) => {
        return this.bpmn_stateHandle(h, row)
      }
    },
    {
      title: "整改状态",
      key: "crsrmRectifyFlagStr",
      minWidth: 130
    },
    {
      title: "更新时间",
      key: "crsrmUpdateTime",
      minWidth: 150
    },
    {
      title: "采购人所属的一级利润中心",
      key: "crsrmPurchaserSbuStr",
      minWidth: 196
    },
/*    {
      title: "上报国资委状态",
      key: "pushStateStr",
      minWidth: 150
    },*/
    {
      title: "操作",
      align: "left",
      fixed: "right",
      width: 100,
      render: (h, { row }) => {
        return h("RowTools", {
          props: {
            data: [
              {
                type: 'icon',
                icon: 'md-eye',
                text: '查看',
                handle: () => this.detailHandle(row.id)
              },
              {
                type: 'icon',
                icon: 'md-document',
                text: '历史记录',
                handle: () => this.historyRecord(row, "supplier/history")
              }
            ]
          }
        });
      }
    }
  ];
}

export const detailField = {
  baseInfo: {
    crsrmBiddingId: {
      name: "采购包或标段编码",
      type: "input"
    },
    crsrmBiddingName: {
      name: "采购包或标段名称",
      type: "input"
    },
    crsrmPurchaserSbu: {
      name: "采购人所属的一级利润中心",
      type: "select"
    },
    crsrmSupplierName: {
      name: "投标人/供应商名称",
      type: "input"
    },
    crsrmSupplierSocialCredit: {
      name: "投标人/供应商代码",
      type: "input"
    },
    crsrmSupplierQty: {
      name: "投标人/供应商总数",
      type: "input"
    },
    crsrmBiddingDocument: {
      name: "投标文件分项报价表",
      type: "input"
    },
    crsrmState: {
      name: "数据状态（润智采）",
      type: "select"
    },
    crsrmRectifyFlag: {
      name: "整改状态",
      type: 'select'
    }
  },
  submitInfo: {
    crsrmSourceSystemNumStr: {
      name: "来源系统",
      type: "input"
    },
    crsrmDataSourceStr: {
      name: "数据来源",
      type: "input"
    },
    crsrmUpdateTime: {
      name: "更新时间（润智采）",
      type: "input"
    },
    crsrmDocumentNum: {
      name: "文件名个数",
      type: "input"
    },
    crsrmAttachmentNum: {
      name: "附件关联个数",
      type: "input"
    },
    crsrmReporterLdap: {
      name: "报送人账号",
      type: "input"
    },
    crsrmReporterName: {
      name: "报送人姓名",
      type: "input"
    },
    crsrmReporterEmail: {
      name: "报送人邮箱",
      type: "input"
    },
    crsrmReporterPhoneNum: {
      name: "报送人手机号码",
      type: "input"
    }
  }
};

